added methods connect, disconnect and isConnected