make code robust to missing files