var scope issue patch update