fix to ensure encoder is closed for append methods too
...