Remove lock function and add a script