Fixes a problem which resulted in not correctly reconnecting the client after disconnection