Implemented Scheduled Executor for MainWindow loop