Fixing automatic reconnecting