change onsubmit to addEventListener