fixed bug with duplicate fields in generated function class