Add option to check for a command success

- To ensure we don't hit the bounds for
java heap space