Adding an error handler if file could not be rendered.
Fixing typo