fix usage of deprecated query