Fixing error after changing var names