added error message if failed
put in an emergency file dumper