fixes up res.view callback