change from max to use success with loop