add better recovery handling