fix bug on submit