Setting varibles as local

How: added local before variable definition

Why: as values where persisting between sessions