update submit fuction