fixed a bug with the cron script