added checks for missing files