Connecting submit button to a function