writeWidgetInit template fixed