added support for saving values to local storage.