adds check on internet connection for logout