fix ctx.flash() with res.end()