clear function works but validate want print to dialog.