select logic changed