Correcting end of input in topics controller