fix a bug in the generic classes with the def parameter