small optimization of thread controller, and fixed nagative offset issue in getThreadComments