fix a bug in search