Made join more robust. Rejects repeat joins