only encode the payload if not yet a string