Add exception file handling