bugfix: don't close logger when its not there