ugly verify code