added support for the query method