loop is corrected