email + flash functionality added