Properly scope vars