fix middleware gif, close #322

fixed