Fix exception handling for non existing files