Make variables inside the sub-function local