fix problem with repo.find_by_ids not matching results with ids