fix bug for join.pl