updated javascript for join