extract the exit code from the child process's status correctly now