changes to write registration to db and send email

changes to register to write to db and send email - however getting a
error instaed of the confirmation page.  however I receive the email and
the row is added to db.