Added new history query for linked tables when using a toggle in the UI