fix serialization to local storage