now checking for errors after each file creation