Added client-side validation