fixes search bug JOINDIN-407

Finally fixed #407