Added resource selection for query