update join function