Fixed a bug with log