fixed bug on search on join tables