Fixing bad var reference