Fix code of deleting items