Fixed a bug in the cron job