How to save/prevent the loss of data when the form is suddenly refreshed?