Add function to reset global variables