Fix the log function