added email function to registration