fix a shared_ptr<T[]> problem