Changed query to exists