fixed problem with local variables not being declared in non-recursive functions