throw on middleware init instead of flash() use
updated tests