added flood control middleware as in #18