fixing bug with interpolation