fix an error in allocating memory for fields name and email