fix crash related to items being deleted