serialization loop