fixing pos is undefined for triangulation