Maybe a check if the surface consists of at least one triangle before inserting?