Add check if connection is open