update topic function.