Improve signature validation