router chinging to middleware patten