serialize data only once