updated js because I replace submit element with button element