fixed generics support (I knew it was too easy!)