slight fix for query