i did the lock function