added client side validation