fixed check for internet connection (not complete!)