locking the pointer