fix bug of duplicate remove