improved way to check internet without blocking mode