fixed persistence variable issue by resetting variables