using append to save chunks, and fixed some bug