fixes javascript client-side validation