implemented the append error string function