procedure filtering name to id