locking cleanup