added ensureTopic function