Fix log on error