added raw output data but now gives a run time error at safing any file type