Change back to HashSet and sort by queue id in js