use v3 query API to avoid depreaction warning