Fix cron

fix some errors in first implementation