perform client side validation