Fixed the log function and message