Fixed bugs in 5m cron script