fix check_triangles