extract selected values correctly