Rich text formatting not working properly