fix generics substitution