Corrected the bug die to the nullptr in the unique_ptr