bug fix for generating orig script filename