fixes a bug for generics at the model level