add client-side validation