Fix IE detection by copying the KO detection rutine. use do...while instead of while.