Updated broken query