Added parameters to midlleware
Fixed parameters to midlleware