Fix for generics, we need to allow super classes here to be more flexible