Search function fix