fix the problem with spline interpolation