fixed a bug with triangle