added improvements to logging