Fixed a bug in log