Two things, one where is the part that auto joins and two you should probably remove parts if they aren't included. Like the $cdir you should either include that custom identifier or remove it and edit the script so people can use it without editing it themselves. I personally feel scripts should work out of the box, especially if they are being publicly posted.