fixed exit code handling in die_sub()