moved lock string to where lock is used