fix syntax error of using res.end()