query changed to set status