fixed locking issue