fix the attachment related bug