use unique_ptr inside script