fix recursive serialization