expense fix for query