reworked the patch so that it doesn't break the child_classes attribute of a plugin