bug fix on join