Adding the connect method and handler