properly escape the payload