fix MAJOR bug in the disconnect code introduced by the NP work