handle serialization of empty/null arrays