Fixing read/save file functionality