remove old locking, add global lock