implemented by overriding the onQuery.