         console.log err
         res.end 'There was an error!'
       name = if req.body.name? and String(req.body).length isnt 0 then req.body.name else 'Anonymous'
-      console.log name
       thread = new Thread(
         id: result.postCount
         posts:

    
    # Add markup
    for post, index in result.threads[0].posts
      console.log "Post text before: #{post.text}"
      post.text = markup.parseMarkup req.params.boardName, req.params.id, post.text
      console.log "Post text after: #{post.text}"
      
    res.render 'board/viewThread',
      board: result,

    name: req.body.boardName
  )
  board.save (err, result) ->
    if err?
      console.log err
      req.flash 'info', 'There was an error adding your board!'
      res.redirect "/board"
