fix bug in html mode