fix locking