Changed the order of the script
Changes to the cron script