Yes it is because there is more than one chain in the original file; read the comments in the script.
There are probably lots scripts out there to do this. Note that you would already be finihsed with this task if you had simply done it instead of having to wait for an answer here.

Lennart Nilsson
Karolinska Institutet
Stockholm, Sweden