fixed output file script error