fix defect in polynomial function