Bug 6526 - Add a reference count to avoid crash