Fixed a bug by stopping dropping duplicates