adding JS for validation