convert regular pointer to safer ScopedPointer