fixed join handling bug