fixed bug when trying to res.render, added support for multiple middlewares. Closes #1