fixed bug with vertex count