fixed bug in appendData