changed to append mode after insert to actually be after the insert