Fixed append bug, wasn't writing the entire collection