re-enabled write code for appends (although I doubt it to be incorrect in general)