fixed bug causing transmission of invalid JSON due to encoding of extra quotes and backslashes