added search function if name is not selected