validate loop