Fixed the order of query inputs in query() method.