avoid log(0.0)