fix a mistake about calculating the signature