fixed using joins  and search with different scopes