added json output, query is working