Add error resilience