Fix issue with uploading attachments