fix some invalid HTML
fix bug introduced by separating init function