added trim on the json string