fixed ancestors bug in updating sort order