added logging option