Changed location of res.end