A couple of other things to check.

Which version of KiXtart are you using? JOIN() is fairly recent.

Also, be careful when cutting and pasting code - the single speech marks (') have been known to change when copied from web pages.

The most likely culprit is as Lonkero says, an unmatched single quote earlier on in you script.