added Type check to display an error when using @Model in inner classes