fix bug when adding bad file attachment