query method.