updated append method