         )
       ]
       , (err, result) ->
-        res.redirect "/board/#{req.params.boardName}"
+        res.redirect encodeURI("/board/#{req.params.boardName}")
       )
       
 boardController.viewThread = (req, res, next) ->

      res.redirect "/board"
    else
      req.flash 'info', 'Successfully added board!'
      res.redirect "/board/#{req.body.boardName}"

boardController.view = (req, res, next) ->
  return next() if not req.params.boardName?

            _next()
        )
      ]
      , (err, result) ->
          res.redirect encodeURI("/board/#{req.params.boardName}/thread/#{req.params.id}#p#{currentPostCount}")
      )
      
module.exports = boardController