Fix #62 Script lock does not always work