check for valid form