only flush errors if there is an attachment