Bugfix for auto reconnect