adding logging improvments