add error handling for nearest, linear and cubic interp