Update data state when submitted