Locking pointer and unlocking