fixed locking/unlocking stuff