fixed bugs with item deletion