fixed disconnecting bug when user closes connection