fix signature fd code
refactor signature checking and handling
fix trace message