Added function for exit.