fixed an issue with duplicates