program exits fully when window is closed