Added doConnect and implementation