fixed bug where some data export functions did not take the right argument for the file to write to