What wifi connection are you trying to connect to? Is it a stable connection, and when I say that I mean, is it a private connection? Open line? Hot spot? If you are on a shared wifi connection the signal will drop in and out and the phone can't decide what to do or is trying to connect when it can't.