was passing in the wrong paramter to the render view function, changed from res to req