Properly reset the filename when opening a new file