added javascript form validation