updated logging on exit