widget state serialization