fixed the script process correctly the OUTPUT file