cleanup: pass retcode as well