Fix to support express 4.0 for no longer support res.locals as function