add rack middleware