Add to check valid
Update tests for #4517