improve locking