Added exception handling. If no analytics attachments has been downloaded script exits