validation loop