fix locking technique