Fixed reconnect bug