added js form validation