resolved a bug for function with multiple generics