fixed some bug in search