Fixing exclude filter bug & adding query cache flushing