Added isOpen flag to connection