added the query method