Added error handling for unreadable files