Fixes bug with de-duping logic