a timing bug fix, previous version easily generate endless browser windows.