small amendment to route middleware with parameters