Added logic to get the emailaddress