move potatocaptcha check to a function