The issue was there was a replace("\"", "") in the bottom of the script. If you remove this it will fix the issue.
replace("\"", "")