add timeout during initial check of directory and file existence.