added logging control