moved the onSuccess reset handler before the redirect