Added checking for invalid file access.