How to start a new file after nearly completing one