corrects res.end()