applied comments and fix bug where the folded threads were saved only after refreshing the entire page