use correct query for shp output