fix for getting filenames for attachments