Add global var reset logic