added code to notify user via email.