Fixed a bug where a text file content gets erased while pressing the back button