Fix a bug where search could 500