Adding parent class with JS and getParents only checks until a certain point