Prevent memory leak by automatically deleting the item info when the scope is left