added safety code if there are no errors in triangle set it to zero