capture exit code of COMMAND