fixed checking for query publicity