re-arranged the logging of the alarm.