Script still running after ssh

I have the lines below on my script:

script.ksh:

case `hostname` in
   some_host)
         ssh server1A "/home/script.ksh $1 $2"
         ssh server1B "/home/script.ksh $1 $2"
         ssh server1C "/home/script.ksh $1 $2"
         ssh server1D "/home/script.ksh $1 $2"
         ssh server1E "/home/script.ksh $1 $2"
   ;;
esac

#some validations here

#multiple commands and if statements here

echo "end"

My assumption is, this will run "script.sh" to five server (server1A, server2B, etc).

But when i execute this script, it works fine until it finishes running in server1A, server1B, server1C, server1D and server1E. I was hoping after running in server1E the script will stop. But it doesnt. After the fifth "run" (in server1E), the script continues to execute, but this time it runs in (probably)some_host, which is invalid.

How can I exit the whole script after the last ssh (SERVER1E)?

And also, this is not important but would be nice to know, how can I execute a command, only on the last "iteration". I mean right before the script ends, im not sure how to do it since it restarts the whole script entirely.

What arguments do you pass to script.ksh ?

Let us assume that you invoke it as:

./script.ksh arg1 arg2

where are1 and arg2 are the arguments you use.

Show us the output you get when you invoke it with:

ksh -xv ./script.ksh arg1 arg2