fix the function definition in generics