Fix bug on cron job query - table name was hardcoded