fixed filtering duplicate ids