Fixing stringify function to not strip trailing double-quote from JSON.stringify function