search by id function