Adding additional check in log()