fixed bug with generics