Fixed lock function