made wirte failurecsv append to error file