fix bug in log