fix the log method