added reference count for outside things