locking bug fix