fix infinite loop when traversing post_parents