       return _lastPassInRun reversedNodes.slice(index + 1)
   return 'black'
 
-sgfObjectWithMoveAdded = (sgfObject, col=null, row=null, color=null) ->
+sgfObjectWithMoveAdded = (sgfObject, color=null, col=null, row=null) ->
   if col != null and row != null
     coordStr = encodeSgfCoord col, row
   else
     coordStr = ''
 
+  if color == null
+    color = nextPlayerInSgfObject sgfObject
   sgfTag = switch color
     when 'black' then 'B'
     when 'white' then 'W'

        # generated by WTForms, server-side
        $('.confirm_button').prop('disabled', false)
        newSgfObject = sgfObjectWithMoveAdded @props.sgfObject,
                                              xy.x, xy.y, nextColor
        setResponseSgf smartgame.generate(newSgfObject)
        # back to React
        @setState proposedMove:

  sgfObject or= smartgame.parse(getInputSgf() or '(;SZ[19])')
  size = parseInt(sgfObject.gameTrees[0].nodes[0].SZ, 10) or 19

  # can't put the response form under React control since it needs to be
  # generated by WTForms, server-side
  $('.confirm_button').prop('disabled', true)
  $('.pass_button').click ->
    newSgfObject = sgfObjectWithMoveAdded sgfObject
    newSgf = smartgame.generate newSgfObject
    setResponseSgf newSgf
    $('#main_form').get(0).submit()

  $('#board').empty()
  reactTop = React.render (React.createElement BoardAreaDom,
