adapt to latest changes in y2r
Fix issue with assigning global variable(issue#458)