added logging capability