properly handle item add/remove events