added logging option to