Search function fixed