fix submit function