throwing join code in a callback function