Added statements to check for file presence