checks if connection opened when connection event listener