Add published check to query