put name for output file. Showing the content of error in the end also