fix var init and avoid JS choking on single quote