fix retention for loop breaking