made addAlarm template member function