fix sign overwriting bug