updated script for email