fix bug in search