added calculate/batch run error checking