added closed query to cron