Issue w/ losing condition

Hi, I cannot seem to get the losing condition to work properly in this code. I’ve swapped the “bot” for “rick” because I’m using a Rick n Morty theme for my page. I’ve followed the steps along side the tutorial and still cannot figure out what I’m doing wrong here.

The code works fine with the win condition but does not change the button text for the lose condition.

My code is below. Any help much appreciated.

let doorImage1 = document.getElementById('door1');
let doorImage2 = document.getElementById('door2');
let doorImage3 = document.getElementById('door3');
let rickDoorPath = './images/rick.svg';
const beachDoorPath = 'https://content.codecademy.com/projects/chore-door/images/beach.svg';
const spaceDoorPath = 'https://content.codecademy.com/projects/chore-door/images/space.svg';
const closedDoorPath = 'https://content.codecademy.com/projects/chore-door/images/closed_door.svg';
let numClosedDoors = 3;
let openDoor1;
let openDoor2;
let openDoor3;
let startButton = document.getElementById('start');

const isRick = (door) => {
    if(door.src === rickDoorPath) {
        return true;
    } else {
        return false;
    }
};

const isClicked = (door) => {
    if (door.src === closedDoorPath) {
        return false;
    } else {
        return true;
    }
};

const playDoor = (door) => {
    numClosedDoors--;
    if(numClosedDoors === 0) {
        gameOver('win');
    } else if(isRick(door)) {
        gameOver('lose');
    }
};

const randomRickDoorGenerator = () => {
    const rickDoor = Math.floor(Math.random() * numClosedDoors);
    if(rickDoor === 0) {
        openDoor1 = rickDoorPath;
        openDoor2 = beachDoorPath;
        openDoor3 = spaceDoorPath;
    } else if (rickDoor === 1) {
        openDoor2 = rickDoorPath;
        openDoor1 = beachDoorPath;
        openDoor3 = spaceDoorPath;
    } else { (rickDoor === 2)
        openDoor3 = rickDoorPath;
        openDoor2 = beachDoorPath;
        openDoor1 = spaceDoorPath;
        }
    };

door1.onclick = () => {
    if(!isClicked(doorImage1)) {
        doorImage1.src = openDoor1;
        playDoor(door1);
    }
};

door2.onclick = () => {
    if(!isClicked(doorImage2)) {
        doorImage2.src = openDoor2;
        playDoor(door2);
    }
};

door3.onclick = () => {
    if(!isClicked(doorImage3)) {
        doorImage3.src = openDoor3;
        playDoor(door3);
    }
};

function gameOver(status) {
    if (status === 'win') {
        startButton.innerHTML = 'You win! Play again?';
    } else {
        startButton.innerHTML = 'Game over! Play again?';
    }
}

randomRickDoorGenerator();