added check for an active internet connection when pressing the login button