[BUGFIX] improve serialization to array