locking and unlocking works