Fix scope on var