if data is an object, JSON.stringify it