added logging functions