fix check if a file exists