added auto-restart on exit