Implement accept and exit.