refined error throwing in surfaceDistR