added client-side validations