fixed a bug on DoF.