Added necessary XInitThreads() call