Added delegates for error handling