function lock