fix one minor bug with the disconnct function