preparations for saving to multiple files