Fix dupe check logic bug