This version is not compilable. Fixing a pointer bug in deconnection