JS captcha race condition fix