Added way to exit the run loop