fix return code on exit