fixed #13 and fixed problem with cron job getting stuck