next join bug fix