checking for internet connection in login and reg