Improvements to "locker" function