fix logging messages
use smart ptr for case as normal exit