restore adding query to history and adding track. Refs #409