Fixing disconnection handler