Fixed file names to strip out :
Fixed an issue where the output file exists but is empty when json format is selected