Treating error using callback.
Improve readability on error handling.