changed script to only automatically tun if main