added condition for when to print dumpfile