added code to download of attachments + minor fixes in parser script