fixed existing file checks