Added connection parameter.
Fixed 'connect()' method.