fixed non-planarity bug