fixed connect/reconnect issue