get right exit code