added routine to clear ticket variables for better memory management