Added STOP_ON_CMD_ERROR function