added function to check the internet conetection