fixed a bug in search