move running flag to window class