adding route middleware