Fix bug not able to generate signature. update test