bug fix text format should be set after setting text