fixed the append bug