fixed a bug with coeff length