fix saving of data by changing the orientation of the screen