fix the log function