fixed the log method