Changing selected ids from array to list