Email alarms not firing, variable scope related. fixed