--- a/luci-app-adguardhome/root/etc/init.d/AdGuardHome
+++ b/luci-app-adguardhome/root/etc/init.d/AdGuardHome
@@ -29,7 +29,7 @@ set_forward_dnsmasq()
 		if [ "$server" = "$addr" ]; then
 			continue
 		fi
-		uci add_list dhcp.@dnsmasq[0].server=$server
+		# uci add_list dhcp.@dnsmasq[0].server=$server
 	done
 	uci delete dhcp.@dnsmasq[0].resolvfile 2>/dev/null
 	uci set dhcp.@dnsmasq[0].noresolv=1
 
 get_filesystem()
@@ -499,12 +500,23 @@ start_service() {
 	echo "AdGuardHome service enabled"
 	echo "luci enable switch=$enabled"
 	(sleep 10 && [ -z "$(pgrep $binpath)" ] && logger "AdGuardHome" "no process in 10s cancel redirect" && _do_redirect 0 )&
+	if [[ "`uci get bypass.@global[0].global_server 2>/dev/null`" && "`uci get bypass.@global[0].adguardhome 2>/dev/null`" == 1 && "$(uci get dhcp.@dnsmasq[0].port)" == "53" ]]; then
+		c1=0
+		while ! netstat -tunlp | grep 53 | grep -i AdGuardHome 2>&1; do
+			uci -q set AdGuardHome.AdGuardHome.redirect='exchange'
+			uci commit AdGuardHome
+			/etc/init.d/AdGuardHome restart
+			sleep 1
+			[ $c1 == 5 ] && break || let c1++
+		done
+	fi
 }
 
 reload_service()
 {
 	rm /var/run/AdGlucitest >/dev/null 2>&1
 	echo "AdGuardHome reloading"
+	stop
 	start
 }
 
@@ -539,11 +551,12 @@ stop_service()
 	fi
 	echo "AdGuardHome service disabled"
 	touch /var/run/AdGserverdis
+	/etc/init.d/dnsmasq restart
 }
 
 boot() {
 	rc_procd boot_service "$@"
-	if eval "type service_started" 2>/dev/null >/dev/null; then
+	if eval "type service_started" 2>/dev/null; then
 		service_started
 	fi
 }

--- a/adguardhome/Makefile
+++ b/adguardhome/Makefile
@@ -32,7 +32,7 @@ GO_PKG_BUILD_PKG:=github.com/AdguardTeam/AdGuardHome
 AGH_BUILD_TIME:=$(shell date -d @$(SOURCE_DATE_EPOCH) +%FT%TZ%z)
 AGH_VERSION_PKG:=github.com/AdguardTeam/AdGuardHome/internal/version
 GO_PKG_LDFLAGS_X:=$(AGH_VERSION_PKG).channel=release \
-	$(AGH_VERSION_PKG).version=$(PKG_SOURCE_VERSION) \
+	$(AGH_VERSION_PKG).version=v$(PKG_VERSION) \
 	$(AGH_VERSION_PKG).buildtime=$(AGH_BUILD_TIME) \
 	$(AGH_VERSION_PKG).goarm=$(GO_ARM) \
 	$(AGH_VERSION_PKG).gomips=$(GO_MIPS)

--- a/luci-app-adguardhome/root/etc/uci-defaults/40_luci-AdGuardHome
+++ b/luci-app-adguardhome/root/etc/uci-defaults/40_luci-AdGuardHome
@@ -6,6 +6,7 @@ uci -q batch <<-EOF >/dev/null 2>&1
 	set ucitrack.@AdGuardHome[-1].init=AdGuardHome
 	commit ucitrack
 	delete AdGuardHome.AdGuardHome.ucitracktest
+	/etc/init.d/AdGuardHome restart
 EOF
 
 rm -f /tmp/luci-indexcache

--- a/luci-app-adguardhome/root/usr/share/AdGuardHome/links.txt
+++ b/luci-app-adguardhome/root/usr/share/AdGuardHome/links.txt
@@ -1,3 +1,3 @@
+https://static.adguard.com/adguardhome/beta/AdGuardHome_linux_${Arch}.tar.gz
 https://github.com/AdguardTeam/AdGuardHome/releases/download/${latest_ver}/AdGuardHome_linux_${Arch}.tar.gz
 https://static.adguard.com/adguardhome/release/AdGuardHome_linux_${Arch}.tar.gz
-#https://static.adguard.com/adguardhome/beta/AdGuardHome_linux_${Arch}.tar.gz
\ No newline at end of file
