add has duplicate function
update test