minor fix in locking