activateAlarm and alarmaActivated functions added