fixed res.end usage