don't see no code.
you say you run a function that declares global variables?
the problem with this approach is that they indeed are declared and on the next run, they will try to do it again -> error.
so, if you really need to have those globals inside that function declaration, you need to test them with isDeclared before declaring them.
_________________________
!

download KiXnet