Udpating select logic.