Bug fix for searching