Changed from toVector to serialize