fixing disconnecting bug