improved verification code