Change MainWindow into a Singleton class for easier access of the instance across other classes, minor bug fix