Fixed missing error check

Fixed missing error check for logging