fixed bugs in interpolation