added serialization for persistent data