change to use custom query