would use retry middleware, but it breaks my tests