fixed the join() code