Add update mode to serialize.py