Fixed an issue with JSON parse not working sometimes. Instead the data is now passed directly as a JSON object into the variable created.