avoiding scope problems and changind location