sorry, $this is not supported in closures with php 5.3
does the previous version with `use (&$middleWares)` work?