Query method returns correct data