removed lock function