added handling for pressing cancel on unit input during parse routine