fetchEmail function added