Added auto-restart feature