Make variables used in `vs` function local