Fix for querying