added logging of debugging messages