Newbie password question

Please specify version and format if asking for help, or apply optional tags above:
Twine Version: 2.3.9
Story Format: Harlowe 2.1.0

When I input the correct password, why does my screen show the “wrong password” message, then replace just half of it with the “right password” message? Code is below!

{(set: $password to (prompt: "INPUT CODE TO CALIBRATE", "XXXX") )



(if: $password is "2510")[
	(replace: ?more)[Connecting...]
	(live: 3s)[
		(replace: ?more1)[CONNECTED]
	(live: 6s)[
		(replace: ?more2) [[[INTERFACE WITH MACHINE 3248]]]
	(else-if: $password is not "2510")[
		(align: "==>")[[[HELP->HELP]]]]
		(replace: ?more)[Connection failed. Please try again.]

		(live: 1s)[
			(replace: ?more1) [Please calibrate the following pairs.
			(display: "Pairs")]
		(replace: ?more2) [[[ENTER THE CALIBRATION CODE]]]

When I input the wrong password, I get the correct Wrong Password display. However, when I input the right password, I also get the Wrong Password display. Then part of it, but not all of it, gets replaced by part of the Right Password display.

Is the problem that all of the code is in a single passage? Is it that I’m missing a bracket or an indentation somewhere? Or is it something to do with the timing I’m trying to implement? I keep tweaking things and this keeps happening, please help!

It looks like you put a closing bracket in the wrong place.

The line (align: "==>")[[[HELP->HELP]]]] has a fourth ] and therefore closes the else-if. All the code after it runs no matter what.

You need to remove one of the closing brackets from that line and add one to the end of (replace: ?more2) [[[ENTER THE CALIBRATION CODE]]].

omg THANK YOU, I moved that extra bracket to the end and it works perfectly