Automatic retry in case of rejected promise