fix historical queries
fix historical queries