added log for query