added code to free tableFormula.