converted code from name to email