Check the exit code