fixed wrong append mode