add save data function
Fix localstorage