Fix bug with searching