fixed a bug in error dumping