improved exception handling for the case when the connection is down.
added cron job