Model as paramemter now working with mesh checking