Tested simple failure scenarios, fixed code to email feilure message