change res.render to res.redirect