don't rely on hash ordering to detect references