fix crash on logger and deletion in smart pointer