Updated to stop before exiting.