our very own retry middleware