fixed bug in advanced search for joins