The reason it iss in the loop, is that on my old laptop, I needed to do an rmmod followed by modprobe inside the loop. Now I have a different wlan chip, so I removed those lines.