     else
       alert('Some shit happened')
 
-    if (cards.length == 1)
+    if (Object.keys(cards).length == 1)
       finished(if state == states['player1'] then 'player1' else 'player2')
     else
       proc_question_panel()


  proc_question_panel = ->
    data = if state == states['player1'] # comp turn
      # TODO if opened pictures <=3 then close cards rnd(3) else comp_question()
      """
        <p>Comp turn</p>

        <p>
          A person #{generate_question()} ?
        </p>

        <p>
          <a href="#" class="answer_yes">Yes</a>
          <a href="#" class="answer_no">No</a>
        </p>
      """
    else
      """
        <p>Your turn</p>

      finished('player2')
    else
      $(@).addClass('back')
      delete p1_cards_obj[face_index]

      if p2_click_try == max_click_try
        finished('player1')
      else
