fixed callback error handling