fix incorrect distinct ids