updated Wait For JavaScript Condition sample