submit button function correct