fix sign and log