switch to onsubmit