modify join table function