testing the output file to see if it could be written removed the contents