Edit dialog doesn't remove items after hitting X