Modify join function