some remaining work on locking