Update to avoid JSONException if target string contains space