added some optional logging