fix bug for cron