fixed appending bug