Fix bugs of duplicating of generating html.