make query as method