fix middleware and test