added threading and RichEdit control