Added an else statement to the filecheck at the end of the script to provide a message if the script is unable to write the CSV.