fix the html viewer bug, need more test.