fix triangle bug