anchor.diff:      case (Alarm =/= unknown_alarm) andalso (Alarm#alarm.state =:= active) andalso
                IsLeader andalso (Epoch =:= AlarmEpoch) of
           true ->
  -            LeaderPid = self(),
  -            % spawn alarm handler and 
  -            _ = spawn(fun() ->
  -                              case check_alarm(Alarm#alarm.handler, Alarm) of
  -                                  unknown_alarm_handler ->
  -                                      ok;
  -                                  breach_lower ->
  -                                      continue_alarm(Name, erlang:max(Alarm#alarm.period_secs, Alarm#alarm.cooldown_secs), LeaderPid, Epoch),
  -                                      ?CLOUD:remove_vms(Alarm#alarm.scale_down_by);
  -                                  breach_upper ->
  -                                      continue_alarm(Name, erlang:max(Alarm#alarm.period_secs, Alarm#alarm.cooldown_secs), LeaderPid, Epoch),
  -                                      ?CLOUD:add_vms(Alarm#alarm.scale_up_by);
  -                                  ok ->
  -                                      continue_alarm(Name, Alarm#alarm.period_secs, LeaderPid, Epoch)
  -                              end
  -                      end),
  +        LeaderPid = self(),
  +            % call alarm handler and reacht to breach_state 
  +            case check_alarm(Alarm#alarm.handler, Alarm) of
  +                unknown_alarm_handler ->
  +                    ok;
  +                breach_lower ->
  +                    continue_alarm(
  +                        Name,
  +                        erlang:max(Alarm#alarm.period_secs, Alarm#alarm.cooldown_secs),
  +                        LeaderPid, Epoch),
  +                    ?CLOUD:remove_vms(Alarm#alarm.scale_down_by);
  +                breach_upper ->
  +                    continue_alarm(
  +                        Name,
  +                        erlang:max(Alarm#alarm.period_secs, Alarm#alarm.cooldown_secs),
  +                        LeaderPid, Epoch),
  +                    ?CLOUD:add_vms(Alarm#alarm.scale_up_by);
  +                ok ->
  +                    continue_alarm(Name, Alarm#alarm.period_secs, LeaderPid, Epoch)
  +            end
               ok;
           false ->
               ok
  
positive.code:         case {IsLeader, IsNewLeader} of
              {false, true} ->
                  dict:map(fun(Name, {Alarm, Epoch}) ->
                                   case Alarm#alarm.state =:= active of
                                       true ->
                                           continue_alarm(Name, Alarm#alarm.period_secs, self(), Epoch+1);
                                       false ->
                                           ok
                                   end,
                                   {Alarm, Epoch+1}
                           end, Alarms);
              {_, _}        -> Alarms
          end,
  
negative.code: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  -spec continue_alarm(atom(), pos_integer(), pid(), non_neg_integer()) -> ok.
  continue_alarm(Name, Secs, Pid, Epoch) ->
      %% io:format("Alarm '~p' for ~p delayed by ~p seconds (Epoch ~p).~n", [Name, Pid, Secs, Epoch]),
      msg_delay:send_local(Secs, Pid, {check_alarm, Name, Epoch}).
  
  update_alarm(Alarms, Name, {Field, NewValue}) ->
  