making sure deletion works on the last item