fixing query code for EPRTR data