refactor res.set() array support