Fixes #677, this fixes an issue where the handler throws an error when the reconnect fails