Fix bug in search