corrected signature for main route middleware