add file mode 'a' for writing datasets