Fixes #53 - fixed attach handler to correctly deal with multiple attachments