add error check on Calc.cs