Code refactor.
Add onException for file not found.