Bugfix. When trying to reconnect: 'connection' is not defined.