Updated update_alarm method