Better check of superclass in associations