Check if internet is connected first