Fix crash on cron