need to fix locking