Add a last item bug fix in removing duplication