finished search functionallity