some fixes with JSON.stringify