Fixed bug that prevented auto-reconnecting