Default Random auto reboots if connected to wifi (One M7)

Well as the title says: my phone reboots automatically if connected to wifi, this happens randomly.
This doesn't happen if connected to 3G, so far happened on multiple wifi networks.

A little background info, I just got this phone a few days and it happened on stock rom, so I thought lets unlock and try a custom rom.
Tried the Insert coin and RevolutionHD rom but same problem.

Tried a search on this forum but couldn't find similar problems