corrected problem where location in the mesh would end up inside the geometry