Correct middleware check logic
0.1.2