updated to use new topics.getPids