legend for query fixed