fixed cron functionality