added counter in the formula parser