fix heirarchy order