Fix bug in ajax search