fix ajax upload for attachments