first client side validation