Fixed onSubmit Logic