changed so that err, next, req and res aren't stored as instance variables