making log optional