fixed problem with persistent variables