how to fix cannot open output file