fixed error on the first connection attempt