catch errors saving files to disk