better file not found detection