Made MainForm Thread-safe.