correct access to query result