Added extra check not to avoid invalid breps