further changes to email confirmation function