fixed the problem with the local vars.