if condition added to Calculator.add