added logging