cron job and fix sorting issue