signature calculation fix