check returncode