return the right exit code