anchor.diff:      lager:info("WS handle ~p ~p ~n",[ Data, State]),
       {ok, Req, State}.
   
  +websocket_info({timer, Msg, Ref}, Req, {joined, Pid, true, N, Ref}) ->
  +    lager:info("WS timer ~p ~p ~n",[Msg, N]),
  +    timer:send_after(?PROMPT_REPEAT, {timer, Msg, Ref}),
  +    {reply, {text, jsx:encode(transform(Msg))}, Req, {joined, Pid, true, N + 1, Ref}};
  +websocket_info({timer, _, _}, Req, S) ->
  +    {ok, Req, S};
   websocket_info(Msg, Req, State) ->
       lager:info("WS info ~p ~n",[Msg]),
  -    {reply, {text, jsx:encode(transform(Msg))}, Req, State}.
  +    {reply, {text, jsx:encode(transform(Msg))}, Req, waiting_state(Msg, State)}.
   
   websocket_terminate(Reason, _Req, State) ->
           lager:info("WS TERMINATE ~p ~p~n",[Reason, State]),
   	ok.
  +
  +waiting_state({prompt, _} = Msg, {joined, Pid, _, _, _}) ->
  +    Ref = make_ref(),
  +    timer:send_after(?PROMPT_REPEAT, {timer, Msg, Ref}),
  +    {joined, Pid, true, 0, Ref};
  +waiting_state(_, S) ->
  +    S.
   
   handle([<<"login">>, N], {} = S) ->
       Name = binary_to_list(N),
  
positive.code: 	Card ->
  	    lager:info("Playing ~p~n",[Card]),
  	    R = table_sup:play(TablePid, Card),
  	    {response(R, play), S}
      end;
  handle([<<"save">>, Cds], {joined, TablePid} = S) ->
      Cs = (catch lists:map(fun decode_card/1, Cds)),
      case Cs of
  	{'EXIT', _} ->
  
negative.code:     TableName = binary_to_list(N),
      R = table_sup:join_or_create(TableName, true),
      {Resp, NewState} = case R of
  		   {ok, Pid} -> {{ok}, {joined, Pid, false, 0, empty}};
  		   E -> {E, S}
  	       end,
      {response(Resp, join), NewState};
  handle([<<"leave">>], {joined, TablePid, _, _, _} = S) ->
      R = table_sup:leave(TablePid),
      NewState = case R of
  		   {ok} -> {logged_in};
  		   _ -> S
  	       end,
      {response(R, leave), NewState};
  handle([<<"lielais">>], {joined, TablePid, _, _, _} = S) ->
      R = table_sup:lielais(TablePid),
      {response(R, lielais), new_state(R, S)};
  handle([<<"zole">>], {joined, TablePid, _, _, _} = S) ->
      R = table_sup:zole(TablePid),
      {response(R, zole), new_state(R, S)};
  handle([<<"pass">>], {joined, TablePid, _, _, _} = S) ->
      R = table_sup:pass(TablePid),
      {response(R, pass), new_state(R, S)};
  handle([<<"last_game">>], {joined, TablePid, _, _, _} = S) ->
      R = table_sup:last_game(TablePid),
      {response(R, last_game), S};
  handle([<<"tables">>], S) ->
      spawn(?MODULE, get_tables, [self()]),
      {response({ok}, tables), S};
  handle([<<"play">>, Crd], {joined, TablePid, _, _, _} = S) ->
      Cs = (catch decode_card(Crd)),
      case Cs of
  	{'EXIT', _} ->
  