adds functionality to form submission