more resilient version