sinatra and middleware