implementing connect/disconnect
finish connect/disconnect