ensure last item is removed properly