anchor.diff:                  catch
                       _:Error -> ?error("Can not update chart ~p: ~p", [Id, Error])
                   end,
  -                ?MODULE:comet_loop(Counter, PageState);
  +                PageState;
   
               {delete_chart, Id} ->
                   gui_jq:wire(<<"deleteChart(\"", (integer_to_binary(Id))/binary, "\");">>),
                   gui_comet:flush(),
  -                ?MODULE:comet_loop(Counter, PageState#page_state{charts = proplists:delete(Id, Charts)})
  +                PageState#page_state{charts = proplists:delete(Id, Charts)}
   
           end
  -    catch Type:Msg ->
  -        ?debug_stacktrace("~p ~p", [Type, Msg]),
  -        error_message(<<"There has been an error in comet process. Please refresh the page.">>)
  -    end.
  +                   catch Type:Msg ->
  +                       ?debug_stacktrace("~p ~p", [Type, Msg]),
  +                       error_message(<<"There has been an error in comet process. Please refresh the page.">>),
  +                       {error, Msg}
  +                   end,
  +    ?MODULE:comet_loop(NewPageState).
   
   
   %% error_message/1
  
positive.code: %% comet_loop/1
  %% ====================================================================
  %% @doc Adds, updates and removes monitoring charts. Handles messages that change chart preferences.
  -spec comet_loop(Counter :: integer(), PageState :: #page_state{}) -> no_return().
  %% ====================================================================
  comet_loop(Counter, #page_state{nodes = Nodes, node = Node, time_range = TimeRange, chart_type = ChartType, charts = Charts} = PageState) ->
      try
          receive
              {set_node, NewNode, ChartTypes} ->
                  case lists:member(ChartType, ChartTypes) of
  
negative.code:                 gui_jq:update(<<"host_label">>, <<"Host: <b>", (get_hostname(NewNode))/binary, "</b>">>),
                  gui_jq:update(<<"host_dropdown">>, host_dropdown_body(NewNode, Nodes)),
                  gui_comet:flush(),
                  PageState#page_state{node = NewNode};
  
              {set_time_range, NewTimeRange} ->
                  gui_jq:update(<<"time_range_label">>, <<"Time range: <b>", NewTimeRange/binary, "</b>">>),
                  gui_jq:update(<<"time_range_dropdown">>, time_range_dropdown_body(NewTimeRange)),
                  gui_comet:flush(),
                  PageState#page_state{time_range = NewTimeRange};
  
              {set_chart_type, NewChartType, ChartTypes} ->
                  case NewChartType of
  