check exit code of source cmd