compute the signature only if we have to