fix for issue #4 - custom error callback