fix duplicated rels and permission nodes problem