(probably) fix the error in refcount