fix onSubmit function signature