fix locking issue