logic for showing options