Reverted the multithreading code for multiple windows. It is not how multithreading should be implemented