fixed lack of mutex lock in disconnect