changing renderHeader function signature to req, res, next