added client side validation for forms