handle return code of dump better