minor bug fix to the edit script