resolve res.locals before render