Correctly use retry loops