fix waiting for connect command