Fix serialize the data to be set in redis