Fix premature waitfor (selenium)