fix generating html code