before modification topic->id wasn't set after iteration of next_topic

Now it's fixed