add a file-existing check function.