backend join function