implemented connect and close