add missing return for getAllIds and prevent duplicate IDs