Make sure there is a connection before testing