implemented connect and set_context methods