use of prefrences to save the last value submited