adding onsubmit funcionality