bug fixes for cron