logic for drop down