adding lock to script