Fixed bug with appending