fixed bug in handling vertices