move disconnections out of lock