Slideshow not showing correct slides

I have a dropdown menu that, upon making a selection, expands a slideshow and shows the slide corresponding to the menu selection.

My problem is that out of nowhere, slide(1) is showing instead of slide(0) and vice versa.

export function IntroToTheoryDropdown_change() {
if ($w(‘#IntroToTheoryDropdown’).value === ‘Ex#1’)
$w(‘#intrototheoryEX’).expand
($w(‘#intrototheoryEX’).changeSlide(0)
)

if ($w(‘#IntroToTheoryDropdown’).value === ‘Ex#2’)
$w(‘#intrototheoryEX’).expand()
$w(‘#intrototheoryEX’).changeSlide(1)
}

I tried adding conditions to get a script that says “if you make the first choice and its already on the first slide, just expand the slideshow. If you make the first choice and its NOT already on the first slide, show the first slide and expand the slideshow”

Code just seems messier now AND I still have the same baffling result.

Any ideas out there or is this a bizarre bug?
Thanks in advance

Your code:

export function IntroToTheoryDropdown_change() {
if ($w(’ #IntroToTheoryDropdown ‘).value === ‘Ex#1’)
$w(’ #intrototheoryEX ‘).expand //where is the () at the end of expand?
($w(’ #intrototheoryEX ').changeSlide(0) //Why have you got a ( in front of your $w?

Should it not be something like this:

export function IntroToTheoryDropdown_change() {
if ($w(‘#IntroToTheoryDropdown’).value === ‘Ex#1’) {
$w(‘#intrototheoryEX’).expand();
$w(‘#intrototheoryEX’).changeSlide(0);
}

if ($w(‘#IntroToTheoryDropdown’).value === ‘Ex#2’) {
$w(‘#intrototheoryEX’).expand();
$w(‘#intrototheoryEX’).changeSlide(1);
}

Alright thank you. Its always a case of a misplaced bracket smh