added error checking for a situation that somehow prevents all the activity records from being created. Added a function that emails me if this happens