Check for connection before requests