Changed query for cases exporter