added additional checks to signature verification