Updated file access code