fixed a crasher when deleting an item