I had the same problem when I first bought my iPhone, I ended up complaining they acknowledged the issue and I ended up getting a new one. Looks like some of them came with wifi issues like my first one did. It didn't picked up wifi signals even if it was closer, sometimes it would drop it and many other problems.